<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>打印采购入库单内容</title>
    <%= stylesheet_link_tag "/stylesheets/print.css" %>
    <style type="text/css">
      .table{border-collapse:collapse; font-size:13px; height:24px; line-height:24px;}
      .table tr td{border:solid 1px;}
    </style>
  </head>
  <body>
    <table width="680" class="table">
      <thead>
        <tr>
          <td width="45" style="text-align:center">序号</td>
          <td width="230" style="text-align:center">商品名称</td>
          <td width="80" style="text-align:center">商品编号</td>
          <td width="40" style="text-align:center">单位</td>
          <td width="40" style="text-align:center">数量</td>
          <td width="70" style="text-align:center">单价</td>
          <td width="90" style="text-align:center">金额</td>
        </tr>
      </thead>
      <% currentAmount = 0
      i = 1
    %>
      <%@warehousingEntryDetails.each do |warehousingEntryDetail|%>
        <tr>
          <td >&nbsp;<%=i%></td>
          <td >&nbsp;<%=warehousingEntryDetail.product.name%></td>
          <td >&nbsp;<%=warehousingEntryDetail.product.number%></td>
          <td >&nbsp;&nbsp;<%=warehousingEntryDetail.product.unit%> </td>
          <td align="right"><%=warehousingEntryDetail.quantity%>&nbsp;</td>
          <td align="right"><%= number_with_delimiter( '%.2f' % warehousingEntryDetail.unit_price * warehousingEntryDetail.discount)%>&nbsp;</td>
          <td align="right"><%= number_with_delimiter('%.2f' % (warehousingEntryDetail.unit_price * warehousingEntryDetail.discount * warehousingEntryDetail.quantity )) %>&nbsp;
            <% currentAmount += warehousingEntryDetail.unit_price * warehousingEntryDetail.discount * warehousingEntryDetail.quantity
               i = i+1
           %></td>
        </tr>
      <% end%>
      <tr>
        <td > </td>
        <td > </td>
        <td > </td>
        <td >总计:</td>
        <td align="right"><%=@totalQuantity%>&nbsp;</td>
        <td > </td>
        <td align="right"><%=currentAmount %>&nbsp;&nbsp; </td>
      </tr>
    </table>
  </body>
</html>